package itsm.isperp.job;

import itsm.isperp.module.utils.SolrUtils;

import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;

/**
 * 
 * 
 * 
 * @author lizx
 * @date 2014-4-28
 * @since 1.0
 * 
 */
@Service
public class RebulidSearchIndexJob implements Job {
	public static final Logger logger = LoggerFactory
			.getLogger(RebulidSearchIndexJob.class);

	@Override
	public void execute(JobExecutionContext context)
			throws JobExecutionException {
		try {

			SolrUtils.rebuildIndex(true);

		} catch (Exception e) {
			logger.error("建立索引时遇到错误", e);

		}
	}

}
